﻿using Jaws.Core.Web.Entities;
using Jaws.Core.Web.Entities.Pages;
using Jaws.Web.Mvc.Models;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;

namespace Jaws.Tests
{
    
    
    /// <summary>
    ///This is a test class for PageCollectionTest and is intended
    ///to contain all PageCollectionTest Unit Tests
    ///</summary>
    [TestClass()]
    public class PageCollectionTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Save
        ///</summary>
        [TestMethod()]
        public void SaveTest()
        {
            PageCollection target = new PageCollection(); // TODO: Initialize to an appropriate value
            target.Save();
        }

        /// <summary>
        ///A test for Load
        ///</summary>
        [TestMethod()]
        public void LoadTest()
        {
            PageCollection expected = null; // TODO: Initialize to an appropriate value
            PageCollection actual;
            actual = XmlCollectionBase<PageCollection, Page>.Load();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for FindById
        ///</summary>
        [TestMethod()]
        public void FindByIdTest()
        {
            var target = new PageCollection(); // TODO: Initialize to an appropriate value
            string id = string.Empty; // TODO: Initialize to an appropriate value
            Page expected = null; // TODO: Initialize to an appropriate value
            Page actual;
            actual = target.FindById(id);
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for PageCollection Constructor
        ///</summary>
        [TestMethod()]
        public void PageCollectionConstructorTest1()
        {
            PageCollection target = new PageCollection();
        }

        /// <summary>
        ///A test for PageCollection Constructor
        ///</summary>
        [TestMethod()]
        public void PageCollectionConstructorTest()
        {
            IList<Page> pages = null; // TODO: Initialize to an appropriate value
            PageCollection target = XmlCollectionBase<PageCollection, Page>.Load();
        }


        [TestMethod]
        public void CreateRecipe()
        {
            var myobj = new Recipe {Name = "Whatever"};
            myobj.Ingredients.Add("1C Flour");
            myobj.Instructions = "How to do it";
          
            myobj.Save();
        }
    }
}
